package com.suixinsanren.design.state.demo.demo07;

public class NoQuarterState implements State {

    private GumballMachine gumballMachine;

    public NoQuarterState(GumballMachine gumballMachine) {
        this.gumballMachine = gumballMachine;
    }

    @Override
    public void insertQuarter() {
        gumballMachine.setState(gumballMachine.getHasQuarterState());
        System.out.println("您投入了1个硬币");
    }

    @Override
    public void ejectQuarter() {
        System.out.println("对不起，您还没有投币，无法退还硬币");
    }

    @Override
    public void turnCrank() {
        System.out.println("对不起，您还没有投币，无法开始游戏");
    }

    @Override
    public String toString() {
        return "未投币状态";
    }
}
